import request from "@/utils/request";

// 查询所有学生信息列表
export const getStudentListApi = (params) => {
  return request({
    url: "/class/student",
    method: "get",
    params,
  });
};

// 新增学生信息
export const addStudentInfoApi = (data) => {
  return request({
    url: "/class/student",
    method: "post",
    data,
  });
};

// 获取单行数据回显
export const getStudentApi = (id) => {
  return request({
    url: '/class/student/' + id,
    method: 'get',
  })
}
// 修改学生信息
export const editStudentInfoApi = (data) => {
  return request({
    url: "/class/student/" + data.id,
    method: "put",
    data,
  });
};
// 删除
export const delStudentApi = (data) => {
  return request({
    url: "/class/student",
    method: "DELETE",
    data
  });
};

// 归属学科下拉数据
export const getSubjectInfoAPi = (params) => {
  return request({
    url: "/subject/tree",
    method: "get",
    params,
  });
};

// 归属班级下拉数据
export const getClassInfoApi = (params) => {
  return request({
    url: "/class/class",
    method: "get",
    params,
  });
};

// 批量启用禁用
export const getChangeStatusApi = (data) => {
  return request({
    url: "/class/studentChangeStatus",
    method: "put",
    data,
  });
};

